<?php

namespace App\Http\Middleware;

use Closure;

class CheckSession
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(empty(session('web_auth_user'))){
            return response()->json(['code'=>4003,'msg'=>'由于您长时间未登录，已自动为您退出，稍后将自动刷新页面']);
        }

        return $next($request);
    }
}
